package com.dragon.modules.yuegou.query.product;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.product.AttrSkuRefEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

/**
 * 商品规格与sku关系表 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-07-23 09:59:38
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class AttrSkuRefQuery extends AttrSkuRefEntity implements Query<AttrSkuRefEntity> {

    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "spuId")
	private Condition<String> spuIdCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "skuId")
	private Condition<String> skuIdCondition;

    /** 规格ID查询条件 */
	@JsonUnwrapped(prefix = "attributeId")
	private Condition<String> attributeIdCondition;

    /** 规格名称查询条件 */
	@JsonUnwrapped(prefix = "attributeName")
	private Condition<String> attributeNameCondition;

    /** 规格值ID查询条件 */
	@JsonUnwrapped(prefix = "optionId")
	private Condition<String> optionIdCondition;

    /** 规格值查询条件 */
	@JsonUnwrapped(prefix = "optionValue")
	private Condition<String> optionValueCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public AttrSkuRefQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public AttrSkuRefQuery(AttrSkuRefEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public AttrSkuRefQuery(AttrSkuRefQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.spuIdCondition != null) {
			this.spuIdCondition = other.spuIdCondition.copy();
		}
		if(other.skuIdCondition != null) {
			this.skuIdCondition = other.skuIdCondition.copy();
		}
		if(other.attributeIdCondition != null) {
			this.attributeIdCondition = other.attributeIdCondition.copy();
		}
		if(other.attributeNameCondition != null) {
			this.attributeNameCondition = other.attributeNameCondition.copy();
		}
		if(other.optionIdCondition != null) {
			this.optionIdCondition = other.optionIdCondition.copy();
		}
		if(other.optionValueCondition != null) {
			this.optionValueCondition = other.optionValueCondition.copy();
		}
	}

	@Override
	public QueryWrapper<AttrSkuRefEntity> toQueryWrapper() {
		QueryWrapper<AttrSkuRefEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (spuIdCondition != null) {
			spuIdCondition.toWrapper(wrapper, COL_SPU_ID);
		}
		if (skuIdCondition != null) {
			skuIdCondition.toWrapper(wrapper, COL_SKU_ID);
		}
		if (attributeIdCondition != null) {
			attributeIdCondition.toWrapper(wrapper, COL_ATTRIBUTE_ID);
		}
		if (attributeNameCondition != null) {
			attributeNameCondition.toWrapper(wrapper, COL_ATTRIBUTE_NAME);
		}
		if (optionIdCondition != null) {
			optionIdCondition.toWrapper(wrapper, COL_OPTION_ID);
		}
		if (optionValueCondition != null) {
			optionValueCondition.toWrapper(wrapper, COL_OPTION_VALUE);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return spuIdCondition 查询条件
	 */
	public Condition<String> spuId() {
		this.spuIdCondition = new Condition<>();
		return this.spuIdCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return spuIdCondition 查询条件
	 */
	public Condition<String> getSpuIdCondition() {
		return spuIdCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param spuIdCondition 查询条件
	 */
	public void setSpuIdCondition(Condition<String> spuIdCondition) {
		this.spuIdCondition = spuIdCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return skuIdCondition 查询条件
	 */
	public Condition<String> skuId() {
		this.skuIdCondition = new Condition<>();
		return this.skuIdCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return skuIdCondition 查询条件
	 */
	public Condition<String> getSkuIdCondition() {
		return skuIdCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param skuIdCondition 查询条件
	 */
	public void setSkuIdCondition(Condition<String> skuIdCondition) {
		this.skuIdCondition = skuIdCondition;
	}

	/**
	 * 构造并返回规格ID查询条件
	 * 
	 * @return attributeIdCondition 规格ID查询条件
	 */
	public Condition<String> attributeId() {
		this.attributeIdCondition = new Condition<>();
		return this.attributeIdCondition;
	}
	
	/**
	 * 获取规格ID查询条件
	 * 
	 * @return attributeIdCondition 规格ID查询条件
	 */
	public Condition<String> getAttributeIdCondition() {
		return attributeIdCondition;
	}

	/**
	 * 设置规格ID查询条件
	 * 
	 * @param attributeIdCondition 规格ID查询条件
	 */
	public void setAttributeIdCondition(Condition<String> attributeIdCondition) {
		this.attributeIdCondition = attributeIdCondition;
	}

	/**
	 * 构造并返回规格名称查询条件
	 * 
	 * @return attributeNameCondition 规格名称查询条件
	 */
	public Condition<String> attributeName() {
		this.attributeNameCondition = new Condition<>();
		return this.attributeNameCondition;
	}
	
	/**
	 * 获取规格名称查询条件
	 * 
	 * @return attributeNameCondition 规格名称查询条件
	 */
	public Condition<String> getAttributeNameCondition() {
		return attributeNameCondition;
	}

	/**
	 * 设置规格名称查询条件
	 * 
	 * @param attributeNameCondition 规格名称查询条件
	 */
	public void setAttributeNameCondition(Condition<String> attributeNameCondition) {
		this.attributeNameCondition = attributeNameCondition;
	}

	/**
	 * 构造并返回规格值ID查询条件
	 * 
	 * @return optionIdCondition 规格值ID查询条件
	 */
	public Condition<String> optionId() {
		this.optionIdCondition = new Condition<>();
		return this.optionIdCondition;
	}
	
	/**
	 * 获取规格值ID查询条件
	 * 
	 * @return optionIdCondition 规格值ID查询条件
	 */
	public Condition<String> getOptionIdCondition() {
		return optionIdCondition;
	}

	/**
	 * 设置规格值ID查询条件
	 * 
	 * @param optionIdCondition 规格值ID查询条件
	 */
	public void setOptionIdCondition(Condition<String> optionIdCondition) {
		this.optionIdCondition = optionIdCondition;
	}

	/**
	 * 构造并返回规格值查询条件
	 * 
	 * @return optionValueCondition 规格值查询条件
	 */
	public Condition<String> optionValue() {
		this.optionValueCondition = new Condition<>();
		return this.optionValueCondition;
	}
	
	/**
	 * 获取规格值查询条件
	 * 
	 * @return optionValueCondition 规格值查询条件
	 */
	public Condition<String> getOptionValueCondition() {
		return optionValueCondition;
	}

	/**
	 * 设置规格值查询条件
	 * 
	 * @param optionValueCondition 规格值查询条件
	 */
	public void setOptionValueCondition(Condition<String> optionValueCondition) {
		this.optionValueCondition = optionValueCondition;
	}

}
